"""
扫描局域网内所有主机端口 (自动识别局域网内所有运维对象)
依赖nmap
"""
import nmap


nm = nmap.PortScanner()
nm.scan('192.168.101.0/24', arguments='-sn')

for host in nm.all_hosts():
    print(host)

print('a')
